{% extends 'bootbase.html' %}
{% load l10n %}
{% block title %}Projectlocatie {{object.name}}{% endblock title %}
{% block brandname %}{% endblock brandname %}
{% block breadcrumbs %}
<ol class="breadcrumb">
	<li><a href="{% url 'home' %}">Home</a></li>
	<li><a href="{% url 'acacia:project-list' %}">Projecten</a></li>
	<li><a href="{% url 'acacia:project-detail' object.project.id %}">{{object.project.name}}</a></li>
	<li class="active"><a href="{% url 'acacia:projectlocatie-detail' object.id %}">{{object.name}}</a></li>
</ol>
{% endblock breadcrumbs %}
{% block admin_url %}projectlocatie/{{object.id}}{% endblock %}
{% block script %}
{{ block.super }}
{% localize off %}
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
var map;
function initialize() {
    var pos = new google.maps.LatLng({{object.latlon.y}},{{object.latlon.x}});
    map = new google.maps.Map(document.getElementById('map'), {
        zoom: {{zoom}},
        center: pos,
        mapTypeId: google.maps.MapTypeId.{{maptype}}
    });
    var marker = new google.maps.Marker({map: map, position: pos, title: "Locatie {{object.name}}" });
    var contentString = {{content|safe}};
	var infowindow = new google.maps.InfoWindow({content: contentString});
	google.maps.event.addListener(marker, 'click', function() {
    	infowindow.open(map,marker);
  	});
}
$(function(){initialize();});
</script>
{% endlocalize %}
{% endblock %}
{% block content %}
<div class = "container">
<div class = "row-fluid">
<div class = "col-md1">
<h3>{{object.name}}</h3>
{{object.description|safe}}
</div>
<div id = map style="width:100%;height:400px;"></div>
<div class="row-fluid">
<table class="table table-striped">
<thead>
<tr>
<th>Meetlocatie</th>
<th>Webcam</th>
<th>Gegevensbronnen</th>
<th>Bestanden</th>
<th>Parameters</th>
<th>Tijdreeksen</th>
<th>Grafieken</th>
</tr>
</thead>
<tbody>
{% for loc in object.meetlocatie_set.all %}
<tr>
<td><a href="{% url 'acacia:meetlocatie-detail' loc.id %}">{{loc.name}}</a></td>
<td>{% if loc.webcam %}<br/>{{loc.webcam.snapshot|safe}}{%endif%}</td>
<td>{{loc.datasources.count}}</td>
<td>{{loc.filecount}}</td>
<td>{{loc.paramcount}}</td>
<td>{{loc.series|length}}</td>
<td>{{loc.charts|length}}</td>
</tr>
{% empty %}
    <div>Geen meetlocaties gevonden</div>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock content %}
